#ifndef PLANT_H
#define PLANT_H
#include"bullet.h"
#include<QVector>
#include<QLabel>
#include<QMediaPlayer>
#include<QPainter>
#include"sunshine.h"
#include"zom.h"
class plant
{
public:
    //通用属性
    int life;
    int init_life;
    int row;
    int col;
    int fps=1;
    int sum_fps;
    int type;   //植物种类
    QString name;
    QString path;
    //攻击类植物属性
    int attack;
    //发射类植物
    int bullet_pre=0;
    int bullet_fre=1000;
    int bullet_speed=25;
    int bullet_re=75;
    int bullet_type=0;   //0:common 1:reduce_speed
    QVector<bullet*> Bullets;
    //延时爆炸类植物
    int boom_pre=0;
    int boom_fre=5000;
    int boom_re=75;
    bool able_boom=false;
    int boom_cartoon_pre=0;
    int boom_cartoon_fre=400;
    int statue=0;  //状态 0 1 2
    //产阳光植物
    int sun_pre_num=25;
    int sun_pre=0;
    int sun_fre=6200;
    int sun_re=75;
public:
    plant(int T,QString N,int R,int C);
    void update(QVector<zom>& z,QVector<sunshine>&sunshines,QPainter* pa,QPixmap& pm);
};

#endif // PLANT_H
